import { defineStore } from "pinia"
import { getFavorData, getHistoryData } from '@/services/modules/favor'
const useFavorStore = defineStore('favor', {
  state: () => ({
    favorList: [],
    historyList: []
  }),
  actions: {
    async fetchFavorData() {
      const { data } = await getFavorData()
      this.favorList = data.data.items || []
    },
    async fetchHistoryList() {
      const { data } = await getHistoryData()
      this.historyList = data.data.items || []
      console.log(this.historyList, 'history list');
    }
  },
  getters: {}
})
export default useFavorStore